package com.ligotop.admin.utils;

import com.ligotop.admin.security.model.AuthUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtil {

    public static AuthUser getAuthUser(){
        Authentication auth
                = SecurityContextHolder.getContext().getAuthentication();

        AuthUser principal = (AuthUser)auth.getPrincipal();
        return principal;
    }

}
